<?php
/**
 * Author: Traveler
 * Time  : 2021/10/9 16:54
 */

namespace app\model;


use sunshine\basic\BaseModel;
use think\model\relation\BelongsTo;

class IcafeAdslModel extends BaseModel
{
    /**
     * 模型名称
     *
     * @var string
     */
    protected $name = 'icafe_adsl';

    /**
     * 搜索器：icafe_id
     *
     * @param $query
     * @param $value
     * @param $data
     */
    public function searchIcafeIdAttr($query, $value, $data)
    {
        $query->where('icafe_id', $value);
    }

    /**
     * 模型关联：isp
     *
     * @return BelongsTo
     */
    public function isp(): BelongsTo
    {
        return $this->belongsTo(IspModel::class, 'isp_id');
    }
}